Skip to content

Conversation

@BookLaugh
Copy link

If current_app is used directly, it fails to recognize configuration changes. I spent last hour investigating it in our setup where we use Flask with uwsgi and app instance is created later, in a function, not on global level code. This means that 'current_app' pointer is instantiated before QueryInspect object is created. Our code creates QueryInspect object with app object passed to init. And during after_request() call, self.app is not current_app (more precisely: self.app is current_app evaluates to False).

The fix is very small and I can see no reason it could break QueryInspect - actually it makes it more explicit in using app instance passed in init, instead of relying on current_app.

If current_app is used directly, it fails to recognize configuration changes. I spent last hour investigating it in our setup where we use Flask with uwsgi and app instance is created later, in a function, not on global level code. This means that 'current_app' pointer is instantiated before QueryInspect object is created. Our code creates QueryInspect object with app object passed to init. And during after_request() call, self.app is not current_app (more precisely: `self.app is current_app` evaluates to False).

The fix is very small and I can see no reason it could break QueryInspect - actually it makes it more explicit in using app instance passed in init, instead of relying on current_app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant